############################################################## 
## MOD Title: IM Portal 
## MOD Author: masterdavid < webmaster@integramod.com > (Ronald John David) 
##             http://www.integramod.com 
## MOD Description:  Flexible and full-featured portal management addon for phpBB (forum-wide integration)
##                   Multiple-page version with cache system
## MOD Version: 1.2.0
## 
## Installation Level: Intermediate
## Installation Time:  10 Minutes 
## Files To Edit:  includes/constants.php
##		   includes/page_header.php
##		   includes/page_tail.php
##                 language/lang_spanish/lang_admin.php
##                 language/lang_spanish/lang_main.php
##                 login.php
##		   template/YOUR_TEMPLATE/overall_header.tpl
##		   template/YOUR_TEMPLATE/overall_footer.tpl
## Included Files: many (under phpbbroot directory of the package)
############################################################## 
## Author Notes: Backup first your files and database before proceeding with the installation.
##############################################################
##
## MOD History: 
##
##   2004-05-29 - Version 1.2.0
##	- beta period ended with no bug reports :) just a repackaged version
##      - planned IM Portal addons will be made available separately
##      - IM Portal Manual is also made available separately
##
##   2004-05-25 - Version 1.1.1 beta
##	- per portal page permission (user level)
##      - usergroups permission for each block and for each portal page
##      - automatic block position tags using a config file for each layout
##      - automatic block variables in Portal Configuration per installed block 
##	  using a config file
##      - complete control of the cache system through the Portal Configuration in ACP
##      - blocks with or without border, with or without titlebar and with or without background
##
##   2004-05-09 - Version 1.1.0a
##      - add missing procedures in install file to make it forum_wide
##
##   2004-05-02 - Version 1.1.0
##      - minor changes
##      - changes in blocks to enable duplicate blocks in a page
##	- add some debugging code for problems not showing forum-wide blocks
##
##   2004-04-30 - Version 1.0.3 beta
##      - cache system using Cache Lite class with the choice to enable system-wide caching of data; 
##	  administrators can also choose which blocks to cache and the life of cached blocks in seconds
##      - fix minor bugs in some default blocks
##	- requirement for eXtreme Styles mod removed; now, it can be used with the standard
##	  templating system
##
##   2004-04-26 - Version 1.0.2 beta
##      - multi-page portal where each page can have a different layout (you can have extra pages with
##        different information/blocks and layout per page (read readme.txt for usage)
##      - tight integration of layouts, block position tags and blocks in the ACP
##      - confirmation dialog for all delete actions
##      - use of either HTML or BBCode for Text Content for the blocks with standard post capability
##        of phpBB using BBCode
##      - centralization of functions to a file: includes/function_portal.php
##      - portal pages with choice of displaying or not displaying forum-wide blocks
##      - block variables localization through the use of block functions
##
##   2004-04-18 - Version 1.0.1 beta
##      - forum-wide integration of the portal engine
##      - each block now has its own language file
##      - removed the user selection of layout because of the planned multi-page portal
##
##   2004-03-27 - Version 1.0.0
##      - first complete release of portal engine
##      - includes 7 blocks
##      - includes 2 layouts
##
##   2004-03-23 - Version 0.1.0 
##      - first release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ SQL ]------------------------------------------ 
#

execute sql.txt using phpMyAdmin

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/constants.php

# 
#-----[ FIND ]------------------------------------------ 
#

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
// IM Portal http://www.integramod.com
//
define('BLOCKS_TABLE', $table_prefix.'blocks');
define('BLOCK_POSITION_TABLE', $table_prefix.'block_position');
define ('LAYOUT_TABLE',$table_prefix.'layout');
define ('PORTAL_CONFIG_TABLE',$table_prefix.'portal_config');
define ('BLOCK_VARIABLE_TABLE',$table_prefix.'block_variable');

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
#

define('HEADER_INC', TRUE);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//
// IM Portal http://www.integramod.com
//
if(!defined('PORTAL_INIT'))
{
	include($phpbb_root_path . 'includes/functions_portal.' . $phpEx);
	portal_config_init($portal_config);
	include_once($phpbb_root_path . 'includes/lite.'.$phpEx);
	$options = array(
		'cacheDir' => $phpbb_root_path . 'var_cache/',
		'fileLocking' => $portal_config['md_cache_file_locking'],
		'writeControl' => $portal_config['md_cache_write_control'],
		'readControl' => $portal_config['md_cache_read_control'],
		'readControlType' => $portal_config['md_cache_read_type'],
		'fileNameProtection' => $portal_config['md_cache_filename_protect'],
		'automaticSerialization' => $portal_config['md_cache_serialize']
	);
	$var_cache = new Cache_Lite($options);
	define('PORTAL_INIT', TRUE);
}

# 
#-----[ FIND ]------------------------------------------ 
#

$template->pparse('overall_header');

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

//
// IM Portal http://www.integramod.com
//

// debug forum wide Portal
/*if($layout_forum_wide_flag)
	$temp_debug = 1;
else
	$temp_debug = 0;
die('debug: ' . strval(empty($gen_simple_header)) . ' | ' . strval($temp_debug) . ' | ' . strval($portal_config['portal_header']) . ' | ' . strval(defined('HAS_DIED')) . ' | ' . strval(defined('IN_LOGIN')));*/
// debug forum wide Portal

if(empty($gen_simple_header))
{
	if(!$layout_forum_wide_flag&&$portal_config['portal_header']&&(!defined('HAS_DIED'))&&(!defined('IN_LOGIN')))
	{
		$template->set_filenames(array(
			'portal_header'         => 'portal_page_header.tpl')
		);
		portal_parse_blocks($portal_config['default_portal'], TRUE, 'header');
		$template->assign_var('HEADER_WIDTH', $portal_config['header_width']);
		$template->assign_var('PORTAL_HEADER', portal_assign_var_from_handle($template, 'portal_header'));
	}
}

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/page_tail.php

# 
#-----[ FIND ]------------------------------------------ 
#

$template->pparse('overall_footer');

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

//
// IM Portal http://www.integramod.com
//

// debug forum wide Portal
/*if($layout_forum_wide_flag)
	$temp_debug = 1;
else
	$temp_debug = 0;
die('debug: ' . strval($temp_debug) . ' | ' . strval($portal_config['portal_tail']) . ' | ' . strval(defined('HAS_DIED')) . ' | ' . strval(defined('IN_LOGIN')));*/
// debug forum wide Portal

if(!$layout_forum_wide_flag&&$portal_config['portal_tail']&&(!defined('HAS_DIED'))&&(!defined('IN_LOGIN')))
{
	$template->set_filenames(array(
		'portal_tail'         => 'portal_page_tail.tpl')
	);
	portal_parse_blocks($portal_config['default_portal'], TRUE, 'tail');
	$template->assign_var('FOOTER_WIDTH', $portal_config['footer_width']);
	$template->assign_var('PORTAL_TAIL', portal_assign_var_from_handle($template, 'portal_tail'));
}

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_spanish/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#

//
// That's all, Folks!
// -------------------------------------------------

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

//
// IM Portal http://www.integramod.com
//
$lang['Home'] = 'Inicio';

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_spanish/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
#

//
// That's all, Folks!
// -------------------------------------------------

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

//
// IM Portal http://www.integramod.com
//
$lang['BP_Title'] = 'Bloquea la posicin del ttulo';
$lang['BP_Explain'] = 'Desde este panel de control, puede aadir, editar o borrar la posicin de los bloques que pueden ser usados en el portal IM. Las posiciones por defecto son \'header\', \'footer\', \'right\' and \'center\'. Slo posiciones existentes por pgina principal deben aadirse aqu. Cdigos de posiciones que no existan en la etiqueta especificada no aparecern en la pgina principal. Cada llave de posicin y carcter deben ser nicos por cada pgina.';
$lang['BP_Position'] = 'Posicin del carcter';
$lang['BP_Key'] = 'Tecla de Etiqueta de Posicin';
$lang['BP_Layout'] = 'Pgina web';
$lang['BP_Add_Position'] = 'Aadir nueva posicin';
$lang['No_bp_selected'] = 'No se ha seleccionado una posicin para editar';
$lang['BP_Edit_Position'] = 'Editar posicin de bloque';
$lang['Must_enter_bp'] = 'Debe aadir un cdigo de posicin, carcter de posicin y pgina web';
$lang['BP_updated'] = 'Posicin de bloque actualizada';
$lang['BP_added'] = 'Posicin de bloque aadida';
$lang['Click_return_bpadmin'] = 'Pulse %sAqu%s para volver a Administracin de edicin de Bloques.';
$lang['BP_removed'] = 'Posicin de bloque eliminada';
$lang['Portal_wide'] = 'Ancho de Portal';

$lang['No_layout_selected'] = 'No se ha seleccionado pgina de portal para editar';
$lang['Layout_Title'] = 'Pgina de Portal';
$lang['Layout_Explain'] = 'Desde este panel de control, puede aadir, editar o eliminar informacin de la distribucin de sus pginas de portal. Varias pginas de portal pueden usar la misma distribucin. El archivo de plantilla de la distribucin seleccionado debe residir en la carpeta layout que se encuentra en la carpeta template de su foro. No puede eliminar la pgina portal por defecto de su foro. Eliminar una pgina de portal elimina tambin las correspondientes posiciones de los bloques de esa pgina y todos los bloques asignados a ella';
$lang['Layout_Name'] = 'Nombre';
$lang['Layout_Template'] = 'Archivo de Plantilla';
$lang['Layout_Edit'] = 'Editar pgina de portal';
$lang['Layout_Page'] = 'ID de Pgina';
$lang['Layout_View'] = 'Ver por';
$lang['Layout_Forum_wide'] = 'Bloques del ancho del foro?';
$lang['Must_enter_layout'] = 'Debe introducir un nombre y un archivo de plantilla';
$lang['Layout_updated'] = 'Pgina de Portal Actualizada';
$lang['Click_return_layoutadmin'] = 'Presione %sAqu%s para volver a la Administracin de Pgina de Portal';
$lang['Layout_added'] = 'Pgina de Portal Aadida';
$lang['Layout_removed'] = 'Pgina de Portal Eliminada';
$lang['Layout_Add'] = 'Aadir Pgina de Portal';
$lang['Layout_BP_added'] = 'Archivo de Configuracin de la Distribucin accesible: Etiquetas de Posiciones de 
Bloques insertadas automticamente';
$lang['Layout_default'] = 'Por Defecto';
$lang['Layout_make_default'] = 'Hacer Por Defecto';

$lang['Blocks_Title'] = 'Administracin de Bloques';
$lang['Blocks_Explain'] = 'Desde este panel de control, puede aadir, editar, eliminar y mover bloques para cada pgina de portal disponible. Una plantilla de bloque debe existir para cada bloque aadido. Cuando un archivo de bloque es especificado, el contenido insertado es ignorado por el motor(engine) del portal.';
$lang['Choose_Layout'] = 'Seleccione pgina de portal';
$lang['B_Title'] = 'Ttulo de Bloque';
$lang['B_Position'] = 'Posicin de Bloque';
$lang['B_Active'] = 'Activo?';
$lang['B_Display'] = 'Contenido';
$lang['B_HTML'] = 'HTML';
$lang['B_BBCode'] = 'BBCode';
$lang['B_Type'] = 'Tipo';
$lang['B_Border'] = 'Mostrar Borde';
$lang['B_Titlebar'] = 'Mostrar Barra de Ttulo';
$lang['B_Background'] = 'Mostrar Fondo';
$lang['B_Local'] = 'Localizar Barra de Ttulo';
$lang['B_Cache'] = 'Cach?';
$lang['B_Cachetime'] = 'Duracin de Cach';
$lang['B_Groups'] = 'Grupos de Usuarios';
$lang['B_All'] = 'Todos';
$lang['B_Guests'] = 'Slo Invitados';
$lang['B_Reg'] = 'Usuarios Registrados';
$lang['B_Mod'] = 'Moderadores';
$lang['B_Admin'] = 'Administradores';
$lang['B_None'] = 'Nadie';
$lang['B_Layout'] = 'Pgina de Portal';
$lang['B_Page'] = 'Id de Pgina';
$lang['B_Add'] = 'Aadir Bloques';
$lang['Yes'] = 'S';
$lang['No'] = 'No';
$lang['B_Text'] = 'Texto';
$lang['B_File'] = 'Archivo de Bloque';
$lang['B_Move_Up'] = 'Mover Arriba';
$lang['B_Move_Down'] = 'Mover Abajo';
$lang['B_View'] = 'Ver por';
$lang['No_blocks_selected'] = 'No se ha seleccionado Bloque';
$lang['B_Content'] = 'Contenido';
$lang['B_Blockfile'] = 'Archivo de Bloque';
$lang['Block_Edit'] = 'Editar Bloque';
$lang['Block_updated'] = 'Bloque Actualizado';
$lang['Must_enter_block'] = 'Debe introducir un ttulo de bloque';
$lang['Block_added'] = 'Bloque aadido';
$lang['Click_return_blocksadmin'] = 'Pulse %sAqu%s para volver a la Administracin de Bloques.';
$lang['Block_removed'] = 'Bloque eliminado';
$lang['B_BV_added'] = 'Archivo de Configuracin de Bloque disponible: Variables de Bloque insertadas automticamente';

$lang['BV_Title'] = 'Variables de Bloque';
$lang['BV_Explain'] = 'Desde este panel de control puede aadir, editar o eliminar variables de configuracin de bloques que son usadas en IM Portal. Estas variables pueden, entonces, ser configuradas a travs de la pgina de Configuracin de Portal para personalizar su portal.';$lang['BV_Label'] = 'Etiqueta de Campo';
$lang['BV_Sub_Label'] = 'Informacin de Campo';
$lang['BV_Name'] = 'Nombre de Configuracin';
$lang['BV_Options'] = 'Opciones';
$lang['BV_Values'] = 'Valores de Campo';
$lang['BV_Type'] = 'Tipo de Control';
$lang['BV_Block'] = 'Bloque';
$lang['BV_Add_Variable'] = 'Aadir Variable de Bloque';
$lang['No_bv_selected'] = 'No se ha seleccionado Variable de Bloque';
$lang['BV_Edit_Variable'] = 'Editar variable de bloque';
$lang['Must_enter_bv'] = 'Debe introducir una etiqueta de campo y un nombre de configuracin';
$lang['BV_updated'] = 'Variable de Bloque actualizado';
$lang['BV_added'] = 'Variable de Bloque aadida';
$lang['Click_return_bvadmin'] = 'Presione %sAqu%s para volver a la Administracin de Variables de Bloque';
$lang['Config_Name_Explain'] = 'No debe contener espacios';
$lang['Field_Options_Explain'] = 'Obligatorio para listar desplegables y<br />botones de seleccin (delimitado por comas).';
$lang['Field_Values_Explain'] = 'Obligatorio para listas desplegables y<br />botones de seleccin (delimitado por comas).';
$lang['BV_removed'] = 'Variable de Bloque eliminada';

$lang['Config_updated'] = 'Configuracin actualizada';
$lang['Click_return_config'] = 'Clic %sAqu%s para volver a Configuracin';
$lang['Portal_Config'] = 'Configuracin de IM Portal';
$lang['Portal_Explain'] = 'Desde este panel de control, puede establecer todas las configuraciones necesarias para su portal. Las Variables de Bloque listadas en esta pgina pueden ser creadas/actualizadas en la pgina de configuracin de Variables de Bloque';
$lang['Portal_General_Config'] = 'Configuracin general';
$lang['Default_Portal'] = 'Pgina principal por defecto';
$lang['Default_Portal_Explain'] = 'Pgina de inicio del foro';
$lang['Cache_Enabled'] = 'Activar sistema de cach';
$lang['Cache_Enabled_Explain'] = 'Para una carga ms rpida de informacin relacionada con el portal';
$lang['Portal_Header'] = 'Habilitar la cabecera de portal de ancho completo';
$lang['Portal_Header_Explain'] = 'Mostrar siempre el panel de la izquierda';
$lang['Portal_Tail'] = 'Habilitar pie de pgina de portal ancho completo';
$lang['Portal_Tail_Explain'] = 'Mostrar siempre el panel de la derecha';
$lang['Confirm_delete_item'] = 'Est seguro de que desea eliminarlo?';
$lang['Cache_cleared'] = 'Archivos de cach eliminados';

$lang['bbcode_b_help'] = 'Texto en negrilla: [b]text[/b]  (alt+b)';
$lang['bbcode_i_help'] = 'Texto en cursiva: [i]texto[/i]  (alt+i)';
$lang['bbcode_u_help'] = 'Subrayar texto: [u]texto[/u]  (alt+u)';
$lang['bbcode_q_help'] = 'Citar texto: [quote]texto[/quote]  (alt+q)';
$lang['bbcode_c_help'] = 'Mostrar cdigo: [code]cdigo[/code]  (alt+c)';
$lang['bbcode_l_help'] = 'Lista: [list]texto[/list] (alt+l)';
$lang['bbcode_o_help'] = 'Lista ordenada: [list=]texto[/list]  (alt+o)';
$lang['bbcode_p_help'] = 'Insertar imagen: [img]http://image_url[/img]  (alt+p)';
$lang['bbcode_w_help'] = 'Insertar URL: [url]http://url[/url] o [url=http://url]URL texto[/url] (alt+w)';
$lang['bbcode_a_help'] = 'Cierra todas las etiquetas de bbCode abiertas';
$lang['bbcode_s_help'] = 'Color de fuente: [color=red]text[/color]  Nota: Tambin puede usar 
color=#FF0000';
$lang['bbcode_f_help'] = 'Tamao de fuente: [size=x-small]texto pequeo[/size]';

$lang['Emoticons'] = 'Smilies';
$lang['More_emoticons'] = 'Ver ms smilies';

$lang['Font_color'] = 'Color de fuente';
$lang['color_default'] = 'Por defecto';
$lang['color_dark_red'] = 'Rojo oscuro';
$lang['color_red'] = 'Rojo';
$lang['color_orange'] = 'Naranja';
$lang['color_brown'] = 'Marrn';
$lang['color_yellow'] = 'Amarillo';
$lang['color_green'] = 'Verde';
$lang['color_olive'] = 'Oliva';
$lang['color_cyan'] = 'Cyan';
$lang['color_blue'] = 'Azul';
$lang['color_dark_blue'] = 'Azul oscuro';
$lang['color_indigo'] = 'ndigo';
$lang['color_violet'] = 'Violeta';
$lang['color_white'] = 'Blanco';
$lang['color_black'] = 'Negro';

$lang['Font_size'] = 'Tamao de fuente';
$lang['font_tiny'] = 'Enana';
$lang['font_small'] = 'Pequea';
$lang['font_normal'] = 'Normal';
$lang['font_large'] = 'Grande';
$lang['font_huge'] = 'Enorme';

$lang['Close_Tags'] = 'Cerrar etiquetas';
$lang['Styles_tip'] = 'Nota: Los estilos pueden ser aplicados rpidamente a un texto seleccionado.';

# 
#-----[ OPEN ]------------------------------------------ 
#

login.php

# 
#-----[ FIND ]------------------------------------------ 
#

				redirect(append_sid("index.$phpEx", true));

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

				redirect(append_sid("portal.$phpEx", true));

# 
#-----[ FIND ]------------------------------------------ 
#

						$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

						$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "portal.$phpEx";

# 
#-----[ FIND ]------------------------------------------ 
#

			redirect(append_sid("index.$phpEx", true));

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

			redirect(append_sid("portal.$phpEx", true));

# 
#-----[ FIND ]------------------------------------------ 
#

		$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

		$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "portal.$phpEx";

# 
#-----[ FIND ]------------------------------------------ 
#

		redirect(append_sid("index.$phpEx", true));

# 
#-----[ REPLACE ]------------------------------------------ 
#

		redirect(append_sid("portal.$phpEx", true));

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/YOUR_TEMPLATE/overall_header.tpl

# 
#-----[ AT THE END OF THE FILE, ADD ]------------------------------------------ 
#

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
{PORTAL_HEADER}
<td width="10"><img src="images/spacer.gif" alt="" width="10" height="30" /></td>
<td valign="top">

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/YOUR_TEMPLATE/overall_footer.tpl

# 
#-----[ AT THE START OF THE FILE, ADD ]------------------------------------------ 
#

{PORTAL_TAIL}<td width="10"><img src="images/spacer.gif" alt="" width="10" height="30" /></td></tr></table>

# 
#-----[ OPTIONAL ]------------------------------------------ 
#

Create a link in your header to point to portal.php by editing page_header.php and overall_header.tpl

# 
#-----[ COPY ]------------------------------------------ 
#

copy phpbbroot\*.* to forums\*.*
note: if you are using another template aside from subsilver, copy the contents of the subsilver directory in all the template directories that you have installed

# 
#-----[ CHMOD ]------------------------------------------ 
#

create directory var_cache under your phpbb root directory and CHMOD it to 777.

#
#-----[ OTHERS ]-----------------------------------------
#

For a detailed information on using IM Portal, please visit http://www.integramod.com and go the knowledgebase section of the site and check the IM Portal Information category.  For questions/suggestions/requests/bug reports/downloads, go to http://www.integramod.com.  IM Portal manual is now also available at the download section of the site.

Please support the site by checking the ads.  Thanks! :)

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 